<template>
     <el-select v-model="modelValue" clearable style="width: 100px;">
        <el-option v-for="item in statusData" :key="item.code" :label="item.message" :value="item.code" />
    </el-select>
</template>

<script setup lang="ts">
import { ref,defineModel,defineProps } from 'vue'

const modelValue = defineModel()

const props = defineProps({
    enumClassName: {
        type: String,
        required: true,
        default: ''
    },
    isShowall: {
        type: Boolean,
        default: false
    }
})

const statusData = ref<any>([])

onMounted(() => { 
    enumApi.select({ enumClassName: props.enumClassName }).then((data: any) => {
        if(props.isShowall){
            statusData.value = [{ code:0, message: "全部" }]
        }else{
            statusData.value = data
        }
    })
})
</script>